
	let flagId = false;
	
	let flagPwd = false;
$("#username").blur(function(){
	let userid =  /^1[3587]\d{3,9}$/;
	if( userid.test($(this).val()) !== true){
		$(".region_tip_text").html("请输入11位手机号").css({
			color:"#ff0000",
			fontWeight: "800",
		})
	}
		return flagId = true;
})

	
$("#password").blur(function(){
	let userid =  /^1[3587]\d{3,9}$/;
	let regPwd = /.{6,18}/;
	  var regNum = /^\d+$/;
	 
	    var regLetter = /^[a-zA-Z]+$/;
	    
	    var regChar = /^[!@#$%^]+$/;
	
	var _regNum = /\d+/;
	    var _regLetter = /[a-zA-Z]+/;
	    var _regChar = /[!@#.$%^]+/;
	for(i=0 ; i < 5;i++){
			
		if(regNum.test($("#password").val()) || regLetter.test($("#password").val()) || regChar.test( $("#password").val())){
			$("#visiablePwd").html("密码强度：弱");
			return flagPwd = true;
		}else if(_regNum.test( $("#password").val())&& _regLetter.test( $("#password").val()) && _regChar.test( $("#password").val())){
			$("#visiablePwd").html("密码强度：强");
			return flagPwd = true;
			
		}else if($("#password").val() == ""){
			$("#visiablePwd").html("请输入密码");
			return flagPwd = false;
			
		}else{
			$("#visiablePwd").html("密码强度：中");
			return flagPwd = true;
		}
		}
})
	$(".btn_reg_1 ").click(function(){
	

		if(flagPwd && flagId ){
			 
			 $.ajax({
			 	url:"./php/register.php",
			 	type:"post",
			 	data:{
			 		user:$("#username").val(),
			 		pwd:$("#password").val()
			 	},
			 	success:function(resText){
			 		console.log(resText)
			 		if(resText == "0"){
			 			localStorage.setItem('id',$("#username").val());
			 		location.href="index.html";
			 		}else{
			 			alert("账号重复")
			 		}
			 	}
			 })
				return true;
			}else{
				 return false
				$("#visiablePwd").html("请输入密码");
				$(".region_tip_text").html("请输入11位手机号").css({
					color:"#ff0000",
					fontWeight: "800",
				})
			}
			
	})

